<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="UTF-8"%>
<%@ page import=" com.sfxy.form.*" %>
<%@ page import="com.sfxy.dao.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>教师列表信息</title>
	<style type="text/css">
    
	<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	
	width:806px; height:600px;
}
body,td,th {
	font-family: 新宋体;
	color: #660000;
}
.STYLE1{
	font-family: "新宋体";
	color: #660033;
	font-size: 12px;
}

-->
    </style></head>
 <jsp:useBean id="pageset" class="com.sfxy.tool.PageSet" scope="session"></jsp:useBean> 
 <jsp:useBean id="sudao" class="com.sfxy.dao.TeacherDao"  scope="session"></jsp:useBean>
 <%
  	
 	int Page=1;
 	//sList list=null;
 	int pagesize=15;
 
   List  list=sudao.queryTeacher();
  	 list=pageset.getInitPage(list,Page,pagesize);
 	//得到查询到的列表
 	
 
  %>
  <body>
 <form name="formfomr" method="post" >
 <input type="hidden"  id="jsmessage" name="message"  />
  <table width="796"  border="5" cellpadding="3" cellspacing="1" bordercolor="#660000" background="images/back_r2_c2.jpg" class="STYLE1">
  	
  	<tr>
	  <td colspan="12" ><%
  		if(pageset.getrecordSize()<=0){
		out.print("<p align=center><img src=images/icon.gif width=10 height=10>&nbsp;&nbsp;<strong>本系统还没有教师!</strong></p>");}
		else{
		  out.println("<p align=center>&nbsp;&nbsp;&nbsp;&nbsp;<img src=images/icon.gif width=10 height=10>&nbsp;&nbsp;所有教师信息列表!</p>");}
  	 %>	  </td>
    </tr>
	<tr>
	  <td height="30" colspan="12"><div align="right">
	    <input type="button" name="add" value="添加教师" onClick="checkForm('add');">
      </div></td>
    </tr>
    <tr >
      <td height="30"width="54" align="center"><strong>账号</strong></td>
	  <td width="74" align="center"><strong>密码</strong></td>
      <td width="74" align="center"><strong>姓名</strong></td>
	  <td width="45"><strong>性别</strong></td>
      <td width="74" align="center"><strong>QQ号</strong></td>
      <td width="74" align="center"><strong>email</strong></td>
      <td width="74" align="center"><strong>电话号码</strong></td> 
      <td colspan="2"align="center"><strong>执行操作</strong></td>
    </tr>
	<%
		for(int i=0;i<list.size();i++){
			
			 TeacherForm form=(TeacherForm)list.get(i);
	 %>
    <tr>
      <td ><%=form.getTeacherId() %>    </td>
      <td><%=form.getPassword() %></td>
      <td><%=form.getName() %> </td>
     	
      <td align="center"><%=form.getSex() %></td>
      <td><%=form.getQQnumber() %></td>
      <td><%=form.getEmail() %></td>
      <td><%=form.getTelephoneId() %> </td>
      <td><%=form.getWorkId() %></td>
      <td><%=form.getProfession() %></td>
      <td align="center"><%=form.getYN() %>
</td>
      <td width="50">
	       <input type="button" name="update" value="更新" onClick="checkForm('update');">	      </td>
	      <td width="50">
	         <input type="hidden" name="TeacherId" value="<%=form.getTeacherId() %>">
	      <input type="button" name="delete" value="删除" onClick="checkForm('delete');"></td>
    </tr>
    <%} %>
  </table>
   	<%=pageset.printCtrl(Page) %>
   
 </form>
  </body>
</html>
<script type="text/javascript" >
      function checkForm(f){
      document.getElementById("jsmessage").value=f;
      formfomr.action="TeacherMange";
      	formfomr.submit();
      }
      </script>
